package com.reservationserver.mapper.admin;

import com.reservationpojo.domin.vo.InsertReplyvo;
import com.reservationpojo.domin.vo.Usercommentvo;
import com.reservationpojo.entity.Comment;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Commentmapper {

@Select("select comment_id, student_id, comment_data, comment_text, comment_reply from comment\n"+
" order by comment_data desc")
    List<Comment> getComment();
@Update("update comment set comment_reply=#{commentReply}  where comment_id=#{commentId}")
    void insertReply(InsertReplyvo insertReplyvo);
@Insert("insert into comment (comment_id,student_id, comment_data, comment_text) value (#{commentId},#{studentId}, #{commentData}, #{commentText})")
    void insretcomment(Comment comment);
    @Select("select comment_id,comment_data, student_id, comment_text, comment_reply from comment where student_id = #{userId}\n"+
            " order by comment_data desc")
    List<Comment> getUserComment(String userId);
@Delete("delete from comment where comment_id=#{commentId}")
    void deleteComment(String commentId);
}
